<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<head>
<%@ include file="/common/extjs.jsp"%>
<meta name="nav" content="2" />
<meta name="acc" content="1-1" />
<title>请假记录</title>
<script type="text/javascript">
	$(document).ready(function() {
		$("#startdate").addClass("Wate").bind("click", function() {
			WdatePicker({
				skin : 'whyGreen',
				minDate : '1900-10-01',
				dateFmt : 'yyyy-MM-dd '
			});
		});

		$("#usern").click(function() {
			UserNameSelector.getView(function(a, c) {
				$("#usern").val(c);
				$("#userid").val(a);
			}, true).show();
		});
	})
</script>
</head>
<body>
	<div id="heading" class="leave">
		<h6>请假列表</h6>
	</div>
	<div id="message">
		<s:actionmessage theme="custom" cssClass="success" />
	</div>
	<form action="${ctx }/human/leave.action" method="get" class="yform"
		id="mainForm">
		<div id="filter">
			<ul>
				<li>请假时间:<input id="startdate" type="text"
					name="filter_GED_startdate"
					value="${param['filter_GED_startdate'] }"></li>
				<li>请(休)假类型:<pt:code prompt="全部" category="2030"
						name="filter_LIKES_type" default="${param['filter_LIKES_type'] }"></pt:code></li>
				<li>请(休)假人<input type="text" name="usern" id="usern"
					value='<pt:labels type="user" argument1="${param['filter_EQS_userid'] }" single="true"></pt:labels>'
					class="choose" readonly="readonly"> <input id="userid"
					name="filter_EQS_userid" type="hidden" value="${userid}" /></li>
			</ul>
			<div class="type-button">
				<input type="button" value="查询" class="search" onclick="search();">
			</div>
		</div>
		<div id="content">
			<table class="contentTable">
				<tr>
					<th><a id="createDate"
						href="javascript:sort('createDate','asc')">序号</a></th>
					<th><a id="deptid" href="javascript:sort('deptid','asc')">申请部门</a></th>
					<th><a id="userid" href="javascript:sort('userid','asc')">请(休)假人</a></th>
					<th><a id="startdate"
						href="javascript:sort('startdate','asc')">开始时间</a></th>
					<th><a id="enddate" href="javascript:sort('enddate','asc')">结束时间</a></th>
					<th><a id="type" href="javascript:sort('type','asc')">请(休)假类型</a></th>
					<th>操作</th>
				</tr>
				<c:forEach items="${page.result }" var="leave" varStatus="status">
					<tr>
						<td>${page.first+status.index }</td>
						<td><pt:labels type="dept" single="true"
								argument1="${leave.deptid}"></pt:labels></td>
						<td><pt:labels type="user" argument1="${leave.userid }"
								single="true"></pt:labels></td>
						<td>${leave.startdate }</td>
						<td>${leave.enddate }</td>
						<td><pt:code category="2030" code="${leave.type}"></pt:code></td>
						<td><a href="${ctx }/human/leave!input.action?id=${leave.id}">编辑</a>
							<a href="${ctx }/human/leave!delete.action?id=${leave.id}"
							onclick="return confirmDelete();">删除</a> <a
							href="${ctx }/human/leave!word.action?id=${leave.id}">下载</a>
						<c:if test="${empty leave.status || leave.status == '01'}">
								<a href="${ctx}/human/leave!login.action?id=${leave.id}">提交</a>
							</c:if> <c:if test="${not empty leave.status && leave.status != '01' }">
								<a href="${ctx }/human/leave!judge.action?id=${leave.id}">处理</a>
							</c:if> <a
							href="${ctx }/human/leave/history.action?key=${leave.id}&pngFileName=leave.png&acc=1-2">状态</a>
						</td>
					</tr>
				</c:forEach>
			</table>
		</div>
		<jsp:include page="/common/page.jsp" flush="true" />
		<div class="type-button">
			<input type="button"
				onclick="location.href='${ctx}/human/leave!input.action'"
				class="add" value="新增">
		</div>
	</form>
</body>